<template>
	<view>
		<!-- #ifdef MP-TOUTIAO -->
		<view :class="isHideBars ? 'isHide' : ''" class="sideBar">
			<view @click="chooseTitle" v-if="darenChoose" class="chooseTitleBtn">
				<view class="chooseTitle">选择标题</view>
				<image style="width: 16rpx;height: 28rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_backRight.png"></image>
			</view>
			<view v-if="dyInterestShow" class="sideBarItem">
				<image style="width: 91rpx;height: 112rpx;" @click="showGzDyh"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/video_gz.webp"></image>
				<!-- <canvas id="demoCanvas" type="2d"  style="width: 73rpx;height: 66rpx; background-color: #fff"></canvas> -->
			</view>
			<view v-if="!compInfo.subscribe" @click="zjClick" class="sideBarItem">
				<image style="width: 73rpx;height: 66rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/toutiao/icon_zhuiju1.png"></image>
				<view style="margin-top: 8rpx;" class="itemName">追剧</view>
			</view>
			<view @click="isLike" class="sideBarItem">
				<image style="width: 73rpx;height: 66rpx;"
					:src="videoItem.alreadyFavorite == 0 ? 'https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/toutiao/icon_like1.png' : 'https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/toutiao/icon_likeTrue1.png'">
				</image>
				<view style="margin-top: 8rpx;" class="itemName">{{ videoItem.favoriteNum | numberFormat }}</view>
			</view>
			<view class="sideBarItem" style="position: relative;">
				<button @click="isShare" :plain="false" hover-class="none"
					style="position: absolute;left: 0;top: 0;opacity: 0;width: 112rpx;height: 112rpx;z-index: 99;"
					class="sideBarItem" aria-role="button" open-type="share">
				</button>
				<image style="width: 73rpx;height: 72rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/toutiao/icon_share1.png"></image>
				<view style="margin-top: 8rpx;" class="itemName">分享</view>
			</view>
			<!-- <view v-if="masterTfShow && isViewOrganization" @click="tapMaster" class="sideBarItem">
				<image style="width: 64rpx;height: 64rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/appH5/darentg_me.png"></image>
				<view style="margin-top: 8rpx;" class="itemName">推广</view>
			</view> -->
		</view>
		<!-- #endif -->
		<!-- #ifdef MP-KUAISHOU -->
		<cover-view class="sideBar">
			<cover-view @click="showCz" v-if="openCz" class="chooseTitleBtn">
				<cover-view class="chooseTitle">强制充值</cover-view>
				<cover-image style="width: 16rpx;height: 28rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_backRight.png"></cover-image>
			</cover-view>
			<!-- 			<button
				:plain="true"
				hover-class="none"
				style="margin-top: 44rpx;border: 0px solid #000000;color: white;padding: 0;margin-bottom: 20rpx;"
				class="sideBarItem"
				aria-role="button"
				open-type="openProfile" 
				user="40300095"
			>
				<cover-image style="width: 78rpx;height: 78rpx;" src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_user.png"></cover-image>
			</button> -->

			<cover-view @click="chooseTitle" v-if="darenChoose" class="chooseTitleBtn">
				<cover-view class="chooseTitle">选择标题</cover-view>
				<cover-image style="width: 16rpx;height: 28rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_backRight.png"></cover-image>
			</cover-view>
			<cover-view v-if="!compInfo.subscribe" @click="zjClick" class="sideBarItem">
				<cover-image style="width: 78rpx;height: 78rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_zhuiju.png"></cover-image>
				<cover-view class="itemName">追剧</cover-view>
			</cover-view>
			<cover-view @click="isLike" style="margin-top: 44rpx;" class="sideBarItem">
				<cover-image style="width: 78rpx;height: 78rpx;"
					:src="videoItem.alreadyFavorite == 0 ? 'https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_like.png' : 'https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_likeTrue.png'"></cover-image>
				<cover-view class="itemName">{{ videoItem.favoriteNum | numberFormat }}</cover-view>
			</cover-view>
			<button @click="isShare" :plain="true" hover-class="none"
				style="margin-top: 44rpx;border: 0px solid #000000;color: white;padding: 0;" class="sideBarItem"
				aria-role="button" open-type="share">
				<cover-image style="width: 78rpx;height: 78rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/uni/icon_share.png"></cover-image>
			</button>
			<cover-view style="margin-top: 0;" class="itemName">分享</cover-view>
			<cover-view v-if="masterTfShow && isViewOrganization" style="margin-top: 37rpx;" @click="tapMaster"
				class="sideBarItem">
				<cover-image style="width: 64rpx;height: 64rpx;margin-top: 10rpx;"
					src="https://res.qiguoread.com/staticResources/fellow_townsman/image/appH5/darentg_me.png"></cover-image>
				<cover-view class="itemName">推广</cover-view>
			</cover-view>
		</cover-view>
		<!-- #endif -->
	</view>
</template>

<script>
import { mapState } from 'vuex';
// const { Parser, Player } = require("../../../util/svgaplayer.tt");
const util = require('@/util/util.js');
export default {
	name: 'videoSidebar',
	props: {
		isHideBars: {
			type: Boolean,
			default: false,
		},
		isShowBtnPlay: {
			type: Boolean,
			default: true
		},
		compInfo: {
			type: Object,
			default: () => {
				return {};
			}
		},
		videoItem: {
			type: Object,
			default: () => {
				return {};
			}
		},
		templateIds: {
			type: Array,
			default: []
		},
		dyShowGz: {
			type: Boolean,
			default: false,
		},
	},
	watch: {
		/* val监听改变的值*/
		videoItem(val) {
			// #ifdef MP-TOUTIAO
			console.log('变化------变化----------变化------变化------');
			if(getApp().globalData.isOperateType){
				this.getDyDiversion(4, 1)
			}
			// #endif
		},
		dyShowGz(val) {
			// #ifdef MP-TOUTIAO
			if(!getApp().globalData.isOperateType){
				this.dyInterestShow = !val
			}
			// #endif
		},
	},
	data() {
		return {
			openCz: wx.getStorageSync('openCz') || false,
			darenChoose: getApp().globalData.darenChoose || false,
			nowScene: getApp().globalData.nowScene || '',
			masterTfShow: true,
			isViewOrganization: false,
			dyInterestShow: false,
			awemeId: '',
			openId: '',
		};
	},
	computed: {
		...mapState(['subscribeIdObj'])
	},
	async created() {
		this.isViewOrganization = getApp().globalData.isViewOrganization
		console.log(getApp().globalData.spreadMode, 'launch/spread_info')
		if (getApp().globalData.callBack && getApp().globalData.spreadMode != 'DOUYIN_XINGTU_MINI_APP' && getApp().globalData.spreadMode != 'DOUYIN_XINGTU_CPA') {
			this.masterTfShow = false
		} else {
			//曝光推广按钮
			this.$statis({
				action: 'EXPOSURE',
				position: 'pages/index_top_1'
			})
		}
		// #ifdef MP-TOUTIAO
		if(getApp().globalData.isOperateType){
			this.getDyDiversion(4, 1)
		}else{
			let {
				openId,
				douYinUserId,//抖音号
			} = getApp().globalData.dyInsertMess
			this.awemeId =douYinUserId
			this.openId = openId
			let statusFollow = await this.getFollowCheckStatus()
			if (!statusFollow.hasFollowed) {
				this.dyInterestShow = true
			}
		}
		
		// #endif
	},

	// async onLoad(e) {
	// 	try {
	// 		const parser = new Parser;
	// 		const player = new Player;
	// 		await player.setCanvas('#demoCanvas')
	// 		const videoItem = await parser.load("https://res.qiguoread.com/staticResources/fellow_townsman/image/video_gz.svga");
	// 		await player.setVideoItem(videoItem);
	// 		player.loops=0
	// 		player.startAnimation();
	// 	} catch (error) {
	// 		console.log(error);
	// 	}
	// },
	methods: {
		async getDyDiversion(num, diversionTarget) {
			let res = await this.zwyRequest({
				method: 'get',
				url: `/douYin/diversion?diversionScene=${num}&diversionTarget=${diversionTarget}`
			})
			if (res && res[0]) {
				this.awemeId = res[0].douYinUserId
				this.openId = res[0].openId
				let statusFollow = await this.getFollowCheckStatus()
				if (!statusFollow.hasFollowed) {
					this.dyInterestShow = true
				}
			}
		},
		async showGzDyh() {
			// let _this = this
			let statusFollow = await this.getFollowCheckStatus()
			console.log(statusFollow, '关注状态---关注状态---关注状态');
			if (statusFollow.hasFollowed) {
				this.dyInterestShow = false
				// //是否调用私信授权播放页按钮
				if (getApp().globalData.isEmpowerStatusBtn) {
					await this.getEmpowerStatus(this.awemeId)
				}

			} else {
				if(!getApp().globalData.isOperateType){
					this.$emit('showGz');
				}
				tt.followAwemeUser({
					awemeId: this.awemeId,
					success: async (res) => {
						console.log("引导关注抖音号成功，已关注:", res.followed);
						this.$statis({
							action: 'EXPOSURE',
							position: 'DY_DIVERSION_DY_USER/DY_DIVERSION_PLAY_PAGE',
						})
						let statusFollow = await this.getFollowCheckStatus()
						this.getReportFollowed(this.awemeId)
						if (statusFollow.hasFollowed && getApp().globalData.isEmpowerStatusBtn) {
							this.dyInterestShow = false
							this.getEmpowerStatus(this.awemeId)
							
						}
						this.$emit('cancelGz');
					},
					fail: (res) => {
						this.$emit('cancelGz');
						console.log("引导关注抖音号失败，错误信息:", res.errMsg);
					},
					// complete(res) {
					// 	this.$emit('cancelGz');
      		//   console.log("调用完成", res);
      		// },
				});

			}
		},
		async getReportFollowed(dyUserId){
			let res = await this.zwyRequest({
				method: 'get',
				url: `/blade/douyinCallback/follow?douYinUserId=${dyUserId}`
			})
		},
		async getEmpowerStatus(dyUserId) {
			let res = await this.zwyRequest({
				method: 'get',
				url: `/douYin/diversion/record_auth?dyUserId=${dyUserId}`
			})
			let _this = this
			if (res && res.needAuth) {
				console.log('调用接口');
				setTimeout(() => {
					tt.authorizePrivateMessage({
						imOpenId: _this.openId,
						success: function (res) {
							console.log("success---私信---私信---私信", res)
							_this.postEmpowerStatus(_this.awemeId)

						},
						fail: function (res) {
							console.log("fail---私信---私信---私信", res)
						},
						complete(res) {
							_this.dyInterestShow = false
							getApp().globalData.isEmpowerStatusBtn = false
							console.log("complete---私信---私信---私信", res)
						}
					})
				}, 1000)
			}
		},

		async postEmpowerStatus(dyUserId) {
			let res = await this.zwyRequest({
				method: 'post',
				url: `/douYin/diversion/record_auth?dyUserId=${dyUserId}`
			})
			this.$statis({
				action: 'AUTH',
				position: 'DY_DIVERSION_DY_USER/DY_DIVERSION_PLAY_PAGE',
			})
			console.log(res, '上报状态');
		},
		// 获取抖音关注
		getFollowCheckStatus() {
			console.log('app===========', tt.checkFollowAwemeState)
			return new Promise((resolve, reject) => {
				tt.checkFollowAwemeState({
					awemeId: this.awemeId,
					success: (res) => {
						console.log('app===========', res)
						if (res && res.hasFollowed) {
							resolve({
								hasFollowed: true
							})
						} else {
							resolve({
								hasFollowed: false
							})
						}
					},
					fail: (error) => {
						console.log('app===========1212', error)
						resolve({
							hasFollowed: false
						})
					}
				})
			})
		},


		tapMaster() {
			//曝光推广弹窗
			this.$statis({
				action: 'EXPOSURE',
				position: 'pages/index_top_2'
			})
			this.$statis({
				action: 'CLICK',
				position: 'pages/index_top_3'
			})
			this.$emit('tapMaster', true);
		},
		toUser() {
			console.log('去服务号')
		},
		showCz() {
			this.$emit('showCz');
		},
		chooseTitle() {
			this.$emit('chooseTitle');
		},
		isMove(e) {
			console.log('isMove', e);
		},
		isLike: util.throttle(async function () {
			let item = JSON.parse(JSON.stringify(this.videoItem));
			let alreadyFavorite = item.alreadyFavorite;
			if (!alreadyFavorite) {
				this.handleAddMess1()
			}
			let systemInfo = await uni.getSystemInfoSync();
			console.log('this.videoItem', this.videoItem);
			let likeUrl = '/cdp/user_favorite/add';
			let unLikeUrl = '/cdp/user_favorite/delete';
			var dataJson = {
				contentId: item.videoId,
				userAgent: systemInfo['model'] || '',
				authorId: item.authorWxUserId ? item.authorWxUserId : '0',
				votesContentType: 'VIDEO'
			};
			if (alreadyFavorite) {
				dataJson._method = 'DELETE';
			}
			this.zwyRequest({
				header: {
					'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'
				},
				url: alreadyFavorite ? unLikeUrl : likeUrl,
				method: 'POST',
				data: dataJson
			}).then(res => {
				if (alreadyFavorite) {
					this.$statis({
						action: 'COLLECTION',
						position: '/compilation/pages/video/video',
						videoId: item.videoId,
						authorId: item.authorWxUserId ? item.authorWxUserId : '0',
						value: -1
					});
				} else {
					this.$statis({
						action: 'COLLECTION',
						position: '/compilation/pages/video/video',
						videoId: item.videoId,
						authorId: item.authorWxUserId ? item.authorWxUserId : '0',
					});
				}
				this.$emit('likeClick');
			});
		}, 1000),

		async handleAddMess1() {
			let _this = this
			console.log(_this.templateIds, 'this.templateIds');
			let res = await uni.requestSubscribeMessage({
				tmplIds: _this.templateIds || []
			})
			console.log('res=====', res)
			if ((res[0] || {}).errCode === 10001027 || (res[0] || {}).errMsg === 'requestSubscribeMessage:fail') {
				uni.showToast({
					title: `请去设置开启订阅消息`,
					icon: 'none'
				})

				// 弹窗拉取失败
				_this.$uma.trackEvent('Ume_Subscribe', {
					name: 'Ume_Subscribe_sign_in_fail'
				})
			}

			let template = []
			let temResult = res[1] || {}

			if (temResult[_this.templateIds[0]] === 'accept') {
				// 弹窗拉取允许
				_this.$uma.trackEvent('Ume_Subscribe', {
					name: 'Ume_Subscribe_sign_in_agree'
				})
			} else if (temResult[_this.templateIds[0]] === 'reject') {
				// 弹窗拉取拒绝
				_this.$uma.trackEvent('Ume_Subscribe', {
					name: 'Ume_Subscribe_sign_in_disagree'
				})
			}
			// 添加订阅模板
			if (
				temResult[_this.templateIds[0]] === 'accept' ||
				temResult[_this.templateIds[1]] === 'accept' ||
				temResult[_this.templateIds[2]] === 'accept'
			) {
				if (temResult[_this.templateIds[0]] === 'accept') { // 签到类型
					template.push({
						templateId: _this.templateIds[0],
						templateType: 3
					})
				}

				if (temResult[_this.templateIds[1]] === 'accept') { // 剧集更新类型
					template.push({
						templateId: _this.templateIds[1],
						templateType: 1
					})
				}

				if (temResult[_this.templateIds[2]] === 'accept') { // 热播新剧提醒类型
					template.push({
						templateId: _this.templateIds[2],
						templateType: 2
					})
				}
				_this.addDingMessTT(template)
			}
		},
		//双击点赞
		dblClick: util.throttle(async function () {
			let systemInfo = await uni.getSystemInfoSync();
			console.log('this.videoItem', this.videoItem);
			let item = JSON.parse(JSON.stringify(this.videoItem));
			let alreadyFavorite = item.alreadyFavorite;
			let likeUrl = '/cdp/user_favorite/add';
			var dataJson = {
				contentId: item.videoId,
				userAgent: systemInfo['model'] || '',
				authorId: item.authorWxUserId ? item.authorWxUserId : '0',
				votesContentType: 'VIDEO'
			};

			this.zwyRequest({
				header: {
					'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'
				},
				url: likeUrl,
				method: 'POST',
				data: dataJson
			}).then(res => {
				if (alreadyFavorite) {
					this.$statis({
						action: 'COLLECTION',
						position: '/compilation/pages/video/video',
						videoId: item.videoId,
						authorId: item.authorWxUserId ? item.authorWxUserId : '0',
						value: -1
					});
				} else {
					this.$statis({
						action: 'COLLECTION',
						position: '/compilation/pages/video/video',
						videoId: item.videoId,
						authorId: item.authorWxUserId ? item.authorWxUserId : '0',
					});
				}
				this.$emit('likeClick');
			});
		}, 1000),
		// 订阅上报
		async addDingMessTT(template) {
			try {
				let res = await this.zwyRequest({
					url: '/mp-api/user_one_time_subscribe/batch',
					method: 'POST',
					data: {
						sourceType: 3,
						sourceId: 0,
						sourceDesc: '',
						templates: template
					}
				})
				console.log('dasdddddd=====', res)
			} catch (error) {
				console.log(error)
			}
		},
		async zjClick() {
			console.log('this.compInfo', this.compInfo);
			// #ifdef MP-KUAISHOU
			this.handleAddMess()
			// #endif
			// #ifdef MP-TOUTIAO
			let appId = uni.getStorageSync('appId') || '';
			if (appId) {
				let idsObj = {
					'tt8032f68f1f0ba85501': [
						'MSG127945641c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1279456d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'tt58602eddc7597c0c01': [
						'MSG128049141c9befe1cbe0be04995d9fb7f9bd99315721',
						'MSG1280491d8f91eb701102666783f5525f53793e915722'
					],
					'ttce10b8ad512e3bd801': [
						'MSG133332741c9befe1cbe0be04995d9fb7f9bd99315721',
						'MSG1333327d8f91eb701102666783f5525f53793e915722'
					],
					'tt201256afbf2c297e01': [
						'MSG135265741c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1352657d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'tt42d2346fddec4c8401': [
						'MSG135265741c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1352657d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'ttcc83ba3e53bd20c801': [
						'MSG132756441c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1327564d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'ttab45ddf8347bb6f601': [
						'MSG13558286eee0f0a5bfb0e21e6275799a55ab65715721', // 剧集更新提醒
						'MSG1355828d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'ttfd538bee626db5aa01': [
						'MSG136947041c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1369470d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'tt4acd3c70d5f3028301': [
						'MSG136947041c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1369470d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'tt8a1efca31520c24401': [
						'MSG136947041c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1369470d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'tt3d164baba22875f301': [
						'MSG136947041c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1369470d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					],
					'tt4a0b3cb6d535026501': [
						'MSG136947041c9befe1cbe0be04995d9fb7f9bd99315721', // 剧集更新提醒
						'MSG1369470d8f91eb701102666783f5525f53793e915722' // 热播新剧提醒
					]
				}
				let tmplIdsList = idsObj[appId];
				let dingyueRes = await uni.requestSubscribeMessage({
					tmplIds: tmplIdsList
				})
				console.log('dingyueRes', dingyueRes);
				let template = [];
				if (dingyueRes[1] && dingyueRes[1][tmplIdsList[0]] === 'accept') { // 剧集更新类型
					template.push({
						templateId: tmplIdsList[0],
						templateType: 1
					})
				}
				if (dingyueRes[1] && dingyueRes[1][tmplIdsList[1]] === 'accept') { // 热播新剧提醒类型 
					template.push({
						templateId: tmplIdsList[1],
						templateType: 2
					})
				}
				console.log('template', template);
				if (template.length > 0) this.addDingMessTT(template);
			}
			// #endif



			this.zwyRequest({
				header: {
					'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'
				},
				url: '/cdp/compilations/subscribe',
				data: {
					id: this.compInfo.id
				},
				method: 'POST'
			}).then(res => {
				let subscribeIdObj = this.$store.state.subscribeIdObj;
				console.log('subscribeIdObj', subscribeIdObj);
				subscribeIdObj[this.compInfo.id] = true;
				this.$store.state.subscribeIdObj = subscribeIdObj;
				uni.showToast({
					title: '追剧成功',
					icon: 'none'
				});
				this.$emit('zjClick');
			});
		},
		// 订阅权限弹窗
		async handleAddMess() {
			try {
				if (getApp().globalData.extConfig['subscribeId4'] || getApp().globalData.extConfig['subscribeId5'] || getApp().globalData.extConfig['subscribeId6']) {
					let res = await uni.requestSubscribeMessage({
						tmplIds: [getApp().globalData.extConfig['subscribeId4'], getApp().globalData.extConfig['subscribeId5']]
					})

					if ((res[0] || {}).errCode === 10001027 || (res[0] || {}).errMsg === 'requestSubscribeMessage:fail repeated request') {
						uni.showToast({
							title: `请去设置开启订阅消息`,
							icon: 'none'
						})

						// 弹窗拉取失败
						this.$uma.trackEvent('Ume_Subscribe', {
							name: 'Ume_Subscribe_sign_in_fail'
						})
					}

					if ((res[1] || {})[getApp().globalData.extConfig['subscribeId4']] === 'ACCEPT') {
						// 弹窗拉取允许
						this.$uma.trackEvent('Ume_Subscribe', {
							name: 'Ume_Subscribe_sign_in_agree'
						})
					} else if ((res[1] || {})[getApp().globalData.extConfig['subscribeId4']] === 'REFUSE') {
						// 弹窗拉取拒绝
						this.$uma.trackEvent('Ume_Subscribe', {
							name: 'Ume_Subscribe_sign_in_disagree'
						})
					}

					this.addDingMess()
				}
			} catch (error) {
				console.log(error)
			}
		},
		// 订阅上报
		async addDingMess() {
			try {
				await this.zwyRequest({
					url: '/mp-api/user_one_time_subscribe/batch',
					method: 'POST',
					data: {
						sourceType: 3,
						sourceId: 0,
						sourceDesc: '',
						templates: [
							{
								templateId: getApp().globalData.extConfig['subscribeId4'],
								templateType: 1
							},
							{
								templateId: getApp().globalData.extConfig['subscribeId5'],
								templateType: 2
							}
						]
					}
				})
			} catch (error) {
				console.log(error)
			}
		},
		isShare: util.throttle(async function () {
			console.log('isShare');
			this.$emit('isShare');
		}, 1000)
	}
};
</script>

<style lang="scss">
.isHide {
	transform: translateX(130px);
}

.chooseTitleBtn {
	.chooseTitle {
		margin-right: 10rpx;
		color: white;
	}

	display: flex;
	align-items: center;
	justify-content: center;
	width: 209rpx;
	height: 67rpx;
	border-radius: 67rpx;
	background: #f36d86;
	border-radius: 34rpx;
	text-align: center;
	line-height: 67rpx;
}

.batchDownBox {
	.backBox {
		margin-top: 94rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		padding-left: 30rpx;
		padding: 0 30rpx 0 60rpx;
		height: 66rpx;
		color: white;
		background: #ff70a2;
		border-radius: 33rpx;
		position: absolute;
		bottom: 100rpx;
		z-index: 101;
		line-height: 66rpx;
		text-align: center;
	}

	position: fixed;
	z-index: 100;
	left: -30rpx;
	width: 260rpx;
	height: 400rpx;
	bottom: 300rpx;
}

.isShareBtn {
	border: 0px solid #000000 !important;
	width: 100rpx;
	height: 100rpx;
	position: absolute;
	opacity: 0;
	z-index: 999;
	left: 0;
	top: 0;
}

.itemName {
	color: white;
	margin-top: 7rpx;
	font-size: 24rpx;
	width: 100%;
	text-align: center;
}

.sideBar {
	transition: .3s;
	position: fixed;
	right: 26rpx;
	bottom: 256rpx;
	z-index: 999;

	.sideBarItem {
		position: relative;
		flex-direction: column;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-bottom: 37rpx;
	}
}
</style>
